package com.example.demo.web.services;

import java.util.Date;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Service;

import com.example.demo.web.dao.SysDAO;
import com.example.demo.web.util.XinLongUtil;


@Service
public class LicenseService {
	private Logger log = LogManager.getLogger(LicenseService.class);
	private SysDAO sysDao;

    @Autowired
    public void setSysDao(SysDAO sysDao){
        this.sysDao =sysDao;
    }
    public void execute(){    	
    	//初始化调试开关
    	String debugflag = sysDao.findByName("system_debug");
    	try{
    		XinLongUtil.xinLongUtil.setDebugflag(Integer.parseInt(debugflag));
    		
    	}catch(Exception e){
    		log.error("[X]----------------------->>>初始化调试开关异常..." + e.getMessage());
    		XinLongUtil.xinLongUtil.setDebugflag(0);
    	}
    }
}